<!DOCTYPE html>
<html lang="en">
{{template "header" .}}
<body>
<div>
    {{template "nav" .}}
    <div class="container">
        <div class="normal-container">
            <article id="messageToast" class="message is-danger" style="display: none">
                <div class="message-body" id="messageToastText">

                </div>
            </article>
            {{template "progress"}}
            <div class="box">
                <div class="table-container">
                    <table class="table is-hoverable is-fullwidth" style="min-width: 700px">
                        <thead>
                        <tr>
                            <th style="width:62%">名称</th>
                            <th style="width:8%">操作</th>
                            <th style="width:10%">文件大小</th>
                            <th style="width:20%">更新时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{range $index, $file := .files}}
                        <tr>
                            {{if $file.IsFolder }}
                            <td><a class="folder-link" href="{{$file.Link}}">📁 {{$file.Name}}</a></td>
                            <td></td>
                            <td></td>
                            {{ else }}
                            <td><a class="file-link" href="{{$file.Link}}" target="_blank" download="{{$file.Name}}">📄
                                {{$file.Name}}</a></td>
                            <td style="">
                                <a class="file-link" href="{{$file.Link}}" download="{{$file.Name}}">
                                    <svg t="1656772118144" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                         xmlns="http://www.w3.org/2000/svg" p-id="1883" width="24" height="24">
                                        <path d="M896 672c-17.066667 0-32 14.933333-32 32v128c0 6.4-4.266667 10.666667-10.666667 10.666667H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667v-128c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v128c0 40.533333 34.133333 74.666667 74.666667 74.666667h682.666666c40.533333 0 74.666667-34.133333 74.666667-74.666667v-128c0-17.066667-14.933333-32-32-32z"
                                              p-id="1884" fill="#333333"></path>
                                        <path d="M488.533333 727.466667c6.4 6.4 14.933333 8.533333 23.466667 8.533333s17.066667-2.133333 23.466667-8.533333l213.333333-213.333334c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0l-157.866667 157.866667V170.666667c0-17.066667-14.933333-32-32-32s-34.133333 14.933333-34.133333 32v456.533333L322.133333 469.333333c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l211.2 213.333334z"
                                              p-id="1885" fill="#333333"></path>
                                    </svg>
                                </a>
                                <span class="file-link" onclick='copyLink("/{{$file.Link}}")' style="cursor: pointer">
                                    <svg t="1671422296199" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                         xmlns="http://www.w3.org/2000/svg" p-id="2683" width="24" height="24">
                                        <path d="M672 832 224 832c-52.928 0-96-43.072-96-96L128 160c0-52.928 43.072-96 96-96l448 0c52.928 0 96 43.072 96 96l0 576C768 788.928 724.928 832 672 832zM224 128C206.368 128 192 142.368 192 160l0 576c0 17.664 14.368 32 32 32l448 0c17.664 0 32-14.336 32-32L704 160c0-17.632-14.336-32-32-32L224 128z"
                                              fill="#5E6570" p-id="2684"></path>
                                        <path d="M800 960 320 960c-17.664 0-32-14.304-32-32s14.336-32 32-32l480 0c17.664 0 32-14.336 32-32L832 256c0-17.664 14.304-32 32-32s32 14.336 32 32l0 608C896 916.928 852.928 960 800 960z"
                                              fill="#5E6570" p-id="2685"></path>
                                        <path d="M544 320 288 320c-17.664 0-32-14.336-32-32s14.336-32 32-32l256 0c17.696 0 32 14.336 32 32S561.696 320 544 320z"
                                              fill="#5E6570" p-id="2686"></path>
                                        <path d="M608 480 288.032 480c-17.664 0-32-14.336-32-32s14.336-32 32-32L608 416c17.696 0 32 14.336 32 32S625.696 480 608 480z"
                                              fill="#5E6570" p-id="2687"></path>
                                        <path d="M608 640 288 640c-17.664 0-32-14.304-32-32s14.336-32 32-32l320 0c17.696 0 32 14.304 32 32S625.696 640 608 640z"
                                              fill="#5E6570" p-id="2688"></path>
                                    </svg>
                                </span>
                            </td>
                            <td>{{$file.Size}}</td>
                            {{ end }}
                            <td>{{$file.ModifiedTime}}</td>
                        </tr>
                        {{end}}
                        </tbody>
                    </table>
                </div>
            </div>
            {{if .readmeFileLink}}
            <script src="/public/lib/marked.umd.min.js"></script>
            <script src="/public/lib/purify.min.js"></script>
            <div class="box">
                <div class="table-container">
                    <div class="box">
                        <article class="media">
                            <div class="media-content">
                                <div class="content" id="readme">

                                </div>
                                <script>
                                    (async function () {
                                        let readmeDiv = document.getElementById("readme");
                                        let res = await fetch("{{.readmeFileLink}}");
                                        let markdown = await res.text();
                                        readmeDiv.innerHTML = DOMPurify.sanitize(marked.parse(markdown));
                                    })();
                                </script>
                            </div>
                        </article>
                    </div>
                </div>
            </div>
            {{end}}
        </div>
    </div>
    {{template "footer" .}}
</div>

{{template "modal"}}
{{template "notice" .}}

</body>
</html>
